package com.store.controller;

import com.store.domain.R;
import com.store.service.CollectService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author yu
 * @date 2024/6/26
 */
@RestController
@RequestMapping("collect")
public class CollectController {
    @Resource
    private CollectService collectService;
    @PostMapping("{bookId}")
    public R collectBook(@PathVariable Integer bookId) {
        return collectService.collectBook(bookId);
    }
    @GetMapping
    public R getUserCollects() {
        return collectService.getUserCollects();
    }
    @DeleteMapping("{ids}")
    public R deleteCollects(@PathVariable Integer[] ids) {
        return collectService.deleteCollects(ids);
    }
}
